﻿using System.Collections.Generic;
using System.Linq;
using cludg.Domain.Content;

namespace cludg.Services.Content
{
	using Repository.Content;

	public class TagService : ITagService
	{
		/// <summary>
		/// Content repository instance
		/// </summary>
		protected readonly ITagRepository Repository;

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="repository">Tag repository instance</param>
		public TagService(
			ITagRepository repository)
		{
			Repository = repository;
		}

		public IQueryable<Tag> All
		{
			get { return Repository.Get(); }
		}

		public IEnumerable<TagCount> GetTagContentCount()
		{
			return Repository.GetTagContentCounts();
		}
	}
}
